import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/main',
    name: 'Main',
    component: () => import('../views/Main.vue'),
    children: [
      {
        path: '/users',
        name: 'Users',
        component: () => import('../views/systemManager/user/Users.vue')
      },
      {
        path: '/welcome',
        name: 'welcome',
        component: () => import('../views/systemManager/welcome/welcome.vue')
      },
      {
        path: '/roles',
        name: 'Roles',
        component: () => import('../views/systemManager/role/Roles.vue')
      },
      {
        path: '/menus',
        name: 'Menus',
        component: () => import('../views/systemManager/menu/Menus.vue')
      },
      {
        path: '/icons',
        name: 'Icon',
        component: () => import('../views/otherManager/icons/Icon.vue')
      },
      {
        path: '/departments',
        name: 'Departments',
        component: () => import('../views/systemManager/department/Departments.vue')
      },
      {
        path: '/attachments',
        name: 'Attachments',
        component: () => import('../views/systemManager/attachment/Attachments.vue')
      },
      {
        path: '/druid',
        name: 'Druid',
        component: () => import('../views/otherManager/druid/Druid.vue')
      },
      {
        path: '/loginLog',
        name: 'LoginLog',
        component: () => import('../views/logManager/log/LoginLog.vue')
      },
      {
        path: '/swagger',
        name: 'Swagger',
        component: () => import('../views/otherManager/swagger/Swagger.vue')
      },
      {
        path: '/blog',
        name: 'Blog',
        component: () => import('../views/otherManager/blog/Blog.vue')
      },
      {
        path: '/logs',
        name: 'Logs',
        component: () => import('../views/logManager/log/Logs.vue')
      },
      {
        path: '/productCategorys',
        name: 'ProductCategorys',
        component: () => import('../views/productManager/ProductCategorys.vue')
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
